Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / SeriesCollection Class / AddFromCells Method / AddFromCells<T>(Int32,Int32,Int32,Int32,Worksheet) Method
The type of Series that will be added to the SeriesCollection.

The Id of the first Row in the CellRange.

The value must be greater than or equal to 0.

The Id of the first Column in the CellRange.

The value must be greater than or equal to 0.

The Id of the last Row in the CellRange.

The value must be greater than or equal to 0.

The Id of the last Column in the CellRange.

The value must be greater than or equal to 0.

The Worksheet where the targeted RowsColumns can be found.

When this is set to null, the Worksheet hosting the targeted SeriesCollection is used.

Example


In This Topic
    AddFromCells<T>(Int32,Int32,Int32,Int32,Worksheet) Method
    In This Topic
    Adds a Series of type T to the SeriesCollection & takes the Series' values from the content of a CellRange, itself identified by RowsColumns Ids.
    Syntax
    'Declaration
     
    
    Public Overloads Function AddFromCells(Of T As {New, Series})( _
       ByVal startRowId As Integer, _
       ByVal startColumnId As Integer, _
       ByVal endRowId As Integer, _
       ByVal endColumnId As Integer, _
       Optional ByVal relatedWorksheet As Worksheet _
    ) As T
    'Usage
     
    
    Dim instance As SeriesCollection
    Dim startRowId As Integer
    Dim startColumnId As Integer
    Dim endRowId As Integer
    Dim endColumnId As Integer
    Dim relatedWorksheet As Worksheet
    Dim value As T
     
    value = instance.AddFromCells(Of T)(startRowId, startColumnId, endRowId, endColumnId, relatedWorksheet)
    public T AddFromCells<T>( 
       int startRowId,
       int startColumnId,
       int endRowId,
       int endColumnId,
       Worksheet relatedWorksheet
    )
    where T: new(), Series

    Parameters

    startRowId

    The Id of the first Row in the CellRange.

    The value must be greater than or equal to 0.

    startColumnId

    The Id of the first Column in the CellRange.

    The value must be greater than or equal to 0.

    endRowId

    The Id of the last Row in the CellRange.

    The value must be greater than or equal to 0.

    endColumnId

    The Id of the last Column in the CellRange.

    The value must be greater than or equal to 0.

    relatedWorksheet

    The Worksheet where the targeted RowsColumns can be found.

    When this is set to null, the Worksheet hosting the targeted SeriesCollection is used.

    Type Parameters

    T
    The type of Series that will be added to the SeriesCollection.

    Return Value

    The Series of type T that has been added to the SeriesCollection.
    Remarks
    The given Ids must correspond either to a single Cell, a single Column or a single Row.
    Example
    // Adds a PieSeries to the Pie3DChart by specifying its values from a range of Cells, Rows & Columns ids (A1 to F6 of the current Worksheet).
     var pieSeries = pie3DChart.SeriesCollection.AddFromCells<PieSeries>( 0, 0, 5, 5 );
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also